package org.lavemylogic.friendsfinder.client;

import javax.jws.WebService;


@WebService(endpointInterface="org.lavemylogic.friendsfinder.client.Client",
targetNamespace = "http://clientws-4vprmkij4p.elasticbeanstalk.com/ClientWS")
public class ClientImpl implements Client {

	public boolean synchronizeFriends(String jObj) {
		boolean jobDone = true;
		
		//Gson gson = new Gson();
		 // Converts JSON string into a List of Product object
		 //Type type = new TypeToken<List<Product>>(){}.getType();
		 //gson.fromJson(jObj, type);

		 // print your List<Product>
		 //System.out.println("prodList: " + prodList);
		 
		/*try {
			JSONArray array = jObj.getJSONArray("friends");
			UserJpaController userJpaController = new UserJpaController();
			
			for(int i = 0 ; i < array.length() ; i++) {
				if(i ==0) {
					User user = new User();
					user.setName((array.getJSONObject(i)).getString("name"));
					UserPK userPK = new UserPK();
					userPK.setId((array.getJSONObject(i)).getInt("id"));
					user.setUserPK(userPK);
					userJpaController.create(user);
				}
			    
			}
		} catch(Exception ex) {
			jobDone = false;
		}*/
		return jobDone;
	}

}